package com.zhangshitong.fiveCharacpter;

/**
 * ���Ͷ�̬����
 * @author zst
 *
 */
public class GenericArray<T> {

	private T[] data;
	private int size;
	
	public GenericArray(int capacity){
		data = (T[]) new Object[capacity];
		size =0;
	}
	
	//无惨构造方法，默认容量为10
	 public GenericArray() {
         this(10);
     }
	 
	 //获取数组容量
	 public int getCapacity(){
		 return data.length;
	 }
	 
	 //获取当前元素的个数
	 public int count(){
		 return size;
	 }
	 
	 //判断数组是否为空
	 public boolean isEmpty(){
		 return size == 0;
	 }
	 
	 
}
